package com.icongyou.enterprise.auth.controller;

import com.icongyou.enterprise.auth.service.UpdateUserService;
import com.icongyou.enterprise.common.result.Result;
import com.icongyou.enterprise.data_aggregation.entity.UserEntity;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
public class UpdateUserController {

    @Resource
    private UpdateUserService updateUserService;
    /**
     * 更新用户信息
     */
    @PutMapping("/update")
    public Result updateUser(@RequestBody UserEntity userEntity) {
        return updateUserService.updateUserInfo(userEntity);
    }
    /**
     * 根据ID获取用户信息
     */
    @GetMapping("/{userId}")
    public Result getUserById(@PathVariable String userId) {
        return updateUserService.getUserById(userId);
    }
}
